<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>登录验证-非常重要</title>
		<script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>
		<script>
			function checkUname(){
				username=$("#uname").val();
		        reg=/^[a-zA-Z0-9]{3,10}$/;
		        if(!reg.test(username)){
		    	$("#uname").css("border-color","red")
		        }
		        else{
		    	$("#uname").css("border-color","white")
		        }
			}
			function checkUpsw(){
	    		psw =$("#upsw").val();
	    		reg=/^[0-9]{6}$/;
	    		if(!reg.test(psw)){
	    		$("#upsw").css("border-color","red")
	    	    }
	    		else{
	    		$("#upsw").css("border-color","black")
	    	   }
	    	 }
		</script>
	</head>
	<body>
		<h3>请输入用户名，密码</h3>
		用户名<input type="text" onblur="checkUname()" id="uname"/><br>
	        密码<input type="password" onblur="checkUpsw()" id="upsw"/><br>
	    <button>登录</button>
	</body>
</html>
